﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SWDataDB.Models;
using SWDataDB.BLL;
using SWDataDB.DAL;
using System.Data;
public partial class Admin_addProj : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }


    
    protected void submit_Click(object sender, EventArgs e)
    {
        //ZL_TBL zlobj = new ZL_TBL();
        //KCInfoEntry kc_in = new KCInfoEntry();
        //zlobj.O_TITLE = this.FileTitle.Text;

        //zlobj.O_GC_DEPART = this.GC_DEPART.Text;
        //zlobj.O_FILE_ID = this.FILE_ID.Text;
        ////zlobj.O_TITLE = this.TITLE.Text;
        //zlobj.O_UNIT = this.UNIT.Text;
        //zlobj.O_HX_PEOPLE = this.HX_PEOPLE.Text;
        //zlobj.O_PEOJ_NAME = this.PEOJ_NAME.Text;
        //zlobj.O_PEOJ_CODE = this.PEOJ_CODE.Text;
        //zlobj.O_DATA_CLASS = this.DATA_CLASS.Text;
        //zlobj.O_CLASS_CODE = this.CLASS_CODE.Text;
        //zlobj.O_ADMIN_REGION = this.ADMIN_REGION.Text;

        //zlobj.O_ADMINREG_CODE = this.ADMINREG_CODE.Text;
        //zlobj.O_MINE_NAME = this.MINE_NAME.Text;
        //zlobj.O_SHEET_NAME = this.SHEET_NAME.Text;
        //zlobj.O_SHEET_ID = this.SHEET_ID.Text;
        //zlobj.O_WORK_LEVEL = this.WORK_LEVEL.Text;
        //zlobj.O_WORKLEVEL_ID = this.WORKLEVEL_ID.Text;

        //zlobj.O_START_DATE = this.START_DATE_Y.Text + "-" + this.START_DATE_M.Text + "-" + this.START_DATE_D.Text;
        //zlobj.O_END_DATE = this.END_DATE_Y.Text + "-" + this.END_DATE_M.Text + "-" + this.END_DATE_D.Text;

        //zlobj.O_START_LONGITUDE = int.Parse((this.START_LONGITUDE_D.Text + this.START_LONGITUDE_F.Text + this.START_LONGITUDE_M.Text));
        //zlobj.O_START_LATITUDE = int.Parse((this.START_LATITUDE_D.Text + this.START_LATITUDE_F.Text + this.START_LATITUDE_M.Text));


        //zlobj.O_END_LONGITUDE = int.Parse((this.END_LONGITUDE_D.Text + this.END_LONGITUDE_F.Text + this.END_LONGITUDE_M.Text));
        //zlobj.O_END_LATITUDE = int.Parse((this.END_LATITUDE_D.Text + this.END_LATITUDE_F.Text + this.END_LATITUDE_M.Text));

        //zlobj.O_MAJOR_MINE = this.MAJOR_MINE.Text;
        //zlobj.O_MINE_CODE = this.MINE_CODE.Text;
        //zlobj.O_PUTIN_DATE = this.PUTIN_DATE_Y.Text + "-" + this.PUTIN_DATE_M.Text + "-" + this.PUTIN_DATE_D.Text;
        //zlobj.O_TRANSF_CODE = this.TRANSF_CODE.Text;

        //zlobj.O_YXIN_NUM_ZL = int.Parse((this.YXIN_NUM_ZL.Text));
        //zlobj.O_YXIN_NUM_X = int.Parse((this.YXIN_NUM_X.Text));
        //zlobj.O_YXIN_NUM_M = int.Parse((this.YXIN_NUM_M.Text));
        //zlobj.O_YXIE_NUM_ZL = int.Parse((this.YXIE_NUM_ZL.Text));
        //zlobj.O_YXIE_NUM_X = int.Parse((this.YXIE_NUM_X.Text));
        //zlobj.O_YXIE_NUM_ZL = int.Parse((this.YXIE_NUM_ZL.Text));
        //zlobj.O_YXIE_NUM_X = int.Parse((this.YXIE_NUM_X.Text));
        //zlobj.O_YXIE_NUM_D = int.Parse((this.YXIE_NUM_D.Text));
        //zlobj.O_BB_NUM_X = int.Parse((this.BB_NUM_X.Text));
        //zlobj.O_BB_NUM_K = int.Parse((this.BB_NUM_K.Text));
        ////zlobj.O_BB_NUM_K_BIG = int.Parse((this.BB_NUM_K_BIG.Text));
        //zlobj.O_GP_NUM_H = int.Parse((this.GP_NUM_H.Text));
        //zlobj.O_GP_NUM_J = int.Parse((this.GP_NUM_J.Text));
        //zlobj.O_YP_NUM_X = int.Parse((this.YP_NUM_X.Text));
        //zlobj.O_YP_NUM_D = int.Parse((this.YP_NUM_D.Text));
        //zlobj.O_BP_NUM_H = int.Parse((this.BP_NUM_H.Text));
        //zlobj.O_BP_NUM_J = int.Parse((this.BP_NUM_J.Text));
        //zlobj.O_QTSW_NUM_X = int.Parse((this.QTSW_NUM_X.Text));
        //zlobj.O_QTSW_NUM_J = int.Parse((this.QTSW_NUM_J.Text));
        //zlobj.O_XGZL_NUM_W = int.Parse((this.XGZL_NUM_W.Text));
        //zlobj.O_XGZL_NUM_T = int.Parse((this.XGZL_NUM_T.Text));
        //zlobj.O_XGZL_NUM_J = int.Parse((this.XGZL_NUM_J.Text));

        //zlobj.O_SECU_LEVEL = this.SECU_LEVEL.Text;
        //zlobj.O_SECU_ID = this.SECU_ID.Text;
        //zlobj.O_SECU_ITEMS = this.SECU_ITEMS.Text;
        //zlobj.O_PROTECT_DATE = this.PROTECT_DATE_Y.Text + "-" + this.PROTECT_DATE_M.Text + "-" + this.PROTECT_DATE_D.Text;


        //zlobj.O_DEAD_LINE = this.DEAD_LINE.Text;
        //zlobj.O_CG_UNIT = this.CG_UNIT.Text;
        //zlobj.O_CG_CODE = this.CG_CODE.Text;
        //zlobj.O_YS_UNIT = this.YS_UNIT.Text;
        //zlobj.O_YS_CODE = this.YS_CODE.Text;
        //zlobj.O_KEY_WORDS = this.KEY_WORDS.Text;
        //zlobj.O_ABSTRACT = this.ABSTRACT.Text;
        //zlobj.O_REMARK = this.REMARK.Text;

        //kc_in.ZLInfoAppend(zlobj);

        ZL_TBL zlobj = new ZL_TBL();
        ZLInfo kc_in = new ZLInfo();

        zlobj.O_TITLE = this.FileTitle.Text;
        zlobj.O_GC_DEPART = this.GC_DEPART.Text;
        zlobj.O_FILE_ID = this.FILE_ID.Text;
        zlobj.O_UNIT = this.UNIT.Text;
        zlobj.O_HX_PEOPLE = this.HX_PEOPLE.Text;
        zlobj.O_PEOJ_NAME = this.PEOJ_NAME.Text;
        zlobj.O_PEOJ_CODE = this.PEOJ_CODE.Text;
        zlobj.O_DATA_CLASS = this.DATA_CLASS.Text;
        zlobj.O_CLASS_CODE = this.CLASS_CODE.Text;
        zlobj.O_ADMIN_REGION = this.XZArea.Text;

        zlobj.O_ADMINREG_CODE = this.ADMINREG_CODE.Text;
        zlobj.O_MINE_NAME = this.MINE_NAME.Text;
        zlobj.O_SHEET_NAME = this.SHEET_NAME.Text;
        zlobj.O_SHEET_ID = this.SHEET_ID.Text;
        zlobj.O_WORK_LEVEL = this.WORK_LEVEL.Text;
        zlobj.O_WORKLEVEL_ID = this.WORKLEVEL_ID.Text;
        zlobj.O_START_DATE = this.START_DATE.Text;// +"-" + this.START_DATE_M.Text + "-" + this.START_DATE_D.Text;
        zlobj.O_END_DATE = this.END_DATE.Text;// + "-" + this.END_DATE_M.Text + "-" + this.END_DATE_D.Text;
        zlobj.O_START_LONGITUDE = int.Parse((this.START_LONGITUDE_D.Text + this.START_LONGITUDE_F.Text + this.START_LONGITUDE_M.Text));
        zlobj.O_START_LATITUDE = int.Parse((this.START_LATITUDE_D.Text + this.START_LATITUDE_F.Text + this.START_LATITUDE_M.Text));


        zlobj.O_END_LONGITUDE = int.Parse((this.END_LONGITUDE_D.Text + this.END_LONGITUDE_F.Text + this.END_LONGITUDE_M.Text));
        zlobj.O_END_LATITUDE = int.Parse((this.END_LATITUDE_D.Text + this.END_LATITUDE_F.Text + this.END_LATITUDE_M.Text));
        zlobj.O_MAJOR_MINE = this.MineType.Text;
        zlobj.O_MINE_CODE = this.MINE_CODE.Text;
        zlobj.O_PUTIN_DATE = this.PUTIN_DATE.Text; // +"-" + this.PUTIN_DATE_M.Text + "-" + this.PUTIN_DATE_D.Text;
        zlobj.O_TRANSF_CODE = this.TRANSF_CODE.Text;
        zlobj.O_YXIN_NUM_ZL = int.Parse((this.YXIN_NUM_ZL.Text));
        zlobj.O_YXIN_NUM_X = int.Parse((this.YXIN_NUM_X.Text));
        zlobj.O_YXIN_NUM_M = int.Parse((this.YXIN_NUM_M.Text));
        zlobj.O_YXIE_NUM_ZL = int.Parse((this.YXIE_NUM_ZL.Text));

        zlobj.O_YXIE_NUM_X = int.Parse((this.YXIE_NUM_X.Text));
        zlobj.O_YXIE_NUM_ZL = int.Parse((this.YXIE_NUM_ZL.Text));
        zlobj.O_YXIE_NUM_D = int.Parse((this.YXIE_NUM_D.Text));
        zlobj.O_BB_NUM_X = int.Parse((this.BB_NUM_X.Text));
        zlobj.O_BB_NUM_K = int.Parse((this.BB_NUM_K.Text));
        zlobj.O_BB_NUM_K_BIG = int.Parse((this.BB_NUM_K_BIG.Text));
        zlobj.O_GP_NUM_H = int.Parse((this.GP_NUM_H.Text));
        zlobj.O_GP_NUM_J = int.Parse((this.GP_NUM_J.Text));
        zlobj.O_YP_NUM_X = int.Parse((this.YP_NUM_X.Text));

        zlobj.O_YP_NUM_D = int.Parse((this.YP_NUM_D.Text));
        zlobj.O_BP_NUM_H = int.Parse((this.BP_NUM_H.Text));
        zlobj.O_BP_NUM_J = int.Parse((this.BP_NUM_J.Text));
        zlobj.O_QTSW_NUM_X = int.Parse((this.QTSW_NUM_X.Text));
        zlobj.O_QTSW_NUM_J = int.Parse((this.QTSW_NUM_J.Text));
        zlobj.O_XGZL_NUM_W = int.Parse((this.XGZL_NUM_W.Text));
        zlobj.O_XGZL_NUM_T = int.Parse((this.XGZL_NUM_T.Text));
        zlobj.O_XGZL_NUM_J = int.Parse((this.XGZL_NUM_J.Text));
        zlobj.O_SECU_LEVEL = this.SECU_LEVEL.Text;
        zlobj.O_SECU_ID = this.SECU_ID.Text;

        zlobj.O_SECU_ITEMS = this.SECU_ITEMS.Text;
        zlobj.O_PROTECT_DATE = this.PROTECT_DATE.Text;// +"-" + this.PROTECT_DATE_M.Text + "-" + this.PROTECT_DATE_D.Text;
        zlobj.O_DEAD_LINE = this.DEAD_LINE.Text;
        zlobj.O_CG_UNIT = this.CG_UNIT.Text;
        zlobj.O_CG_CODE = this.CG_CODE.Text;
        zlobj.O_YS_UNIT = this.YS_UNIT.Text;
        zlobj.O_YS_CODE = this.YS_CODE.Text;
        zlobj.O_KEY_WORDS = this.KEY_WORDS.Text;
        zlobj.O_ABSTRACT = this.ABSTRACT.InnerText;
        zlobj.O_REMARK = this.REMARK.InnerText;



        bool flag=kc_in.IsZLExist(zlobj.O_FILE_ID);
        if (flag)
        {
            Response.Write("<script language=javascript>alert('添加错误！该项目已经存在！');</script>");
        }
        else{
            if (kc_in.AddZLInfo(zlobj) == 1)
            {
                Response.Write("<script language=javascript>alert('添加成功！');location='../Manage/ZLManage.aspx'</script>");
                //Response.Redirect("ZLManage.aspx");
            }
            else
            {
                Response.Write("<script language=javascript>alert('添加失败！');location='../Manage/ZLManage.aspx'</script>");
            } 
        }
    }
}
